#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <vector>
#include "cpplib/parseinputdata.h"

using namespace std;


void Test004();
void Test005();
void Test015();
void Test049();


int main()
{
    //    Test003();
    //    Test004();
    //    Test005();
    Test015();
    return 0;
}


void Test004()
{
#include "T004/findMedianSortedArrays.cpp"
    // T004
    string line;
    vector<int> m, n;
    getline(cin, line);
    parseLine2Nums(line, m, ' ');
    getline(cin, line);
    parseLine2Nums(line, n, ' ');
}

void Test005()
{
#include "T005/longestPalindrome.cpp"
    string line;
    getline(cin, line);
    string ans = Solution().longestPalindrome(line);
    cout << ans << endl;
}

void Test015()
{
#include "T015/threeSum.cpp"
    string line;
    getline(cin, line);
    vector<int> nums;
    parseLine2Nums(line, nums, ',');

    vector<vector<int>> ans;
    ans = Solution().threeSum(nums);

    for(const vector<int>& ary : ans)
    {
        cout << ary[0] << ", " << ary[1] << ", " << ary[1] << endl;
    }
}


void Test049()
{
#include "T049/groupAnagrams.cpp"
    int n;
    cin >> n;
    vector<string> strs;
    for(int i = 0; i < n; i++)
    {
        string line;
        getline(cin, line);
        strs.emplace_back(line);
    }
    auto ans = Solution().groupAnagrams(strs);
    for(auto it1 = ans.begin(); it1 != ans.end(); it1++)
    {
        for(auto it2 = it1->begin(); it2 != it1->end(); it2++)
        {
            cout << &it2 << ", ";
        }
        cout << endl;
    }
}

